// Upgrade NOTE: commented out 'float4x4 _World2Object', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Hidden/TerrainEngine/Details/BillboardWavingDoublePass" {
Properties {
 _WavingTint ("Fade Color", Color) = (0.7,0.6,0.5,0)
 _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" { }
 _WaveAndDistance ("Wave and distance", Vector) = (12,3.6,1,1)
 _Cutoff ("Cutoff", Float) = 0.5
}
SubShader { 
 LOD 200
 Tags { "QUEUE"="Geometry+200" "IGNOREPROJECTOR"="true" "DisableBatching"="true" "RenderType"="GrassBillboard" }
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Geometry+200" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "DisableBatching"="true" "RenderType"="GrassBillboard" }
  Cull Off
  ColorMask RGB
  GpuProgramID 59612
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _WavingTint;
uniform float4 _WaveAndDistance;
uniform float4 _CameraPosition;
uniform float3 _CameraRight;
uniform float3 _CameraUp;
uniform float4 _MainTex_ST;
//uniform float4 _WorldSpaceLightPos0;
uniform float4 _LightColor0;
uniform sampler2D _MainTex;
uniform float _Cutoff;
struct appdata_t
{
    float4 tangent :TANGENT;
    float4 vertex :POSITION;
    float4 color :COLOR;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float4 xlv_COLOR0 :COLOR0;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float4 xlv_COLOR0 :COLOR0;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    tmpvar_1 = in_v.color;
    float3 worldNormal_2;
    float3 tmpvar_3;
    float4 pos_4;
    pos_4 = in_v.vertex;
    float2 offset_5;
    offset_5 = in_v.tangent.xy;
    float3 tmpvar_6;
    tmpvar_6 = (in_v.vertex.xyz - _CameraPosition.xyz);
    float tmpvar_7;
    tmpvar_7 = dot(tmpvar_6, tmpvar_6);
    if((tmpvar_7>_WaveAndDistance.w))
    {
        offset_5 = float2(0, 0);
    }
    pos_4.xyz = (in_v.vertex.xyz + (offset_5.x * _CameraRight));
    pos_4.xyz = (pos_4.xyz + (offset_5.y * _CameraUp));
    float4 vertex_8;
    vertex_8.yw = pos_4.yw;
    float4 color_9;
    color_9.xyz = tmpvar_1.xyz;
    float3 waveColor_10;
    float3 waveMove_11;
    float4 s_12;
    float4 waves_13;
    waves_13 = (pos_4.x * (float4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
    waves_13 = (waves_13 + (pos_4.z * (float4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
    waves_13 = (waves_13 + (_WaveAndDistance.x * float4(1.2, 2, 1.6, 4.8)));
    float4 tmpvar_14;
    tmpvar_14 = frac(waves_13);
    waves_13 = tmpvar_14;
    float4 val_15;
    float4 s_16;
    val_15 = ((tmpvar_14 * 6.408849) - 3.141593);
    float4 tmpvar_17;
    tmpvar_17 = (val_15 * val_15);
    float4 tmpvar_18;
    tmpvar_18 = (tmpvar_17 * val_15);
    float4 tmpvar_19;
    tmpvar_19 = (tmpvar_18 * tmpvar_17);
    s_16 = (((val_15 + (tmpvar_18 * (-0.1616162))) + (tmpvar_19 * 0.0083333)) + ((tmpvar_19 * tmpvar_17) * (-0.00019841)));
    s_12 = (s_16 * s_16);
    s_12 = (s_12 * s_12);
    float tmpvar_20;
    tmpvar_20 = (dot(s_12, float4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
    s_12 = (s_12 * in_v.tangent.y);
    waveMove_11.y = 0;
    waveMove_11.x = dot(s_12, float4(0.024, 0.04, (-0.12), 0.096));
    waveMove_11.z = dot(s_12, float4(0.006, 0.02, (-0.02), 0.1));
    vertex_8.xz = (pos_4.xz - (waveMove_11.xz * _WaveAndDistance.z));
    float3 tmpvar_21;
    tmpvar_21 = lerp(float3(0.5, 0.5, 0.5), _WavingTint.xyz, float3(tmpvar_20, tmpvar_20, tmpvar_20));
    waveColor_10 = tmpvar_21;
    float3 tmpvar_22;
    tmpvar_22 = (vertex_8.xyz - _CameraPosition.xyz);
    float tmpvar_23;
    tmpvar_23 = clamp(((2 * (_WaveAndDistance.w - dot(tmpvar_22, tmpvar_22))) * _CameraPosition.w), 0, 1);
    color_9.w = tmpvar_23;
    float4 tmpvar_24;
    tmpvar_24.xyz = ((2 * waveColor_10) * in_v.color.xyz);
    tmpvar_24.w = color_9.w;
    float4 v_25;
    v_25.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_25.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_25.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_25.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_26;
    v_26.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_26.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_26.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_26.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_27;
    v_27.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_27.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_27.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_27.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_28;
    tmpvar_28 = normalize((((v_25.xyz * in_v.normal.x) + (v_26.xyz * in_v.normal.y)) + (v_27.xyz * in_v.normal.z)));
    worldNormal_2 = tmpvar_28;
    tmpvar_3 = worldNormal_2;
    float3 normal_29;
    normal_29 = worldNormal_2;
    float4 tmpvar_30;
    tmpvar_30.w = 1;
    tmpvar_30.xyz = float3(normal_29);
    float3 res_31;
    float3 x_32;
    x_32.x = dot(unity_SHAr, tmpvar_30);
    x_32.y = dot(unity_SHAg, tmpvar_30);
    x_32.z = dot(unity_SHAb, tmpvar_30);
    float3 x1_33;
    float4 tmpvar_34;
    tmpvar_34 = (normal_29.xyzz * normal_29.yzzx);
    x1_33.x = dot(unity_SHBr, tmpvar_34);
    x1_33.y = dot(unity_SHBg, tmpvar_34);
    x1_33.z = dot(unity_SHBb, tmpvar_34);
    res_31 = (x_32 + (x1_33 + (unity_SHC.xyz * ((normal_29.x * normal_29.x) - (normal_29.y * normal_29.y)))));
    float _tmp_dvx_215 = max(((1.055 * pow(max(res_31, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    res_31 = float3(_tmp_dvx_215, _tmp_dvx_215, _tmp_dvx_215);
    out_v.vertex = UnityObjectToClipPos(vertex_8);
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = mul(unity_ObjectToWorld, vertex_8).xyz;
    out_v.xlv_COLOR0 = tmpvar_24;
    out_v.xlv_TEXCOORD3 = max(float3(0, 0, 0), res_31);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float4 c_3;
    float3 tmpvar_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = _WorldSpaceLightPos0.xyz;
    lightDir_5 = tmpvar_6;
    tmpvar_4 = in_f.xlv_TEXCOORD1;
    float4 tmpvar_7;
    tmpvar_7 = (tex2D(_MainTex, in_f.xlv_TEXCOORD0) * in_f.xlv_COLOR0);
    float x_8;
    x_8 = (tmpvar_7.w - _Cutoff);
    if((x_8<0))
    {
        discard;
    }
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    float4 c_9;
    float4 c_10;
    float diff_11;
    float tmpvar_12;
    tmpvar_12 = max(0, dot(tmpvar_4, tmpvar_2));
    diff_11 = tmpvar_12;
    c_10.xyz = ((tmpvar_7.xyz * tmpvar_1) * diff_11);
    c_10.w = (tmpvar_7.w * in_f.xlv_COLOR0.w);
    c_9.w = c_10.w;
    c_9.xyz = (c_10.xyz + (tmpvar_7.xyz * in_f.xlv_TEXCOORD3));
    c_3.xyz = c_9.xyz;
    c_3.w = 1;
    out_f.color = c_3;
    return out_f;
}


ENDCG

}
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Geometry+200" "IGNOREPROJECTOR"="true" "DisableBatching"="true" "RenderType"="GrassBillboard" }
  ZWrite Off
  Cull Off
  Blend One One
  ColorMask RGB
  GpuProgramID 121266
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _WavingTint;
uniform float4 _WaveAndDistance;
uniform float4 _CameraPosition;
uniform float3 _CameraRight;
uniform float3 _CameraUp;
uniform float4 _MainTex_ST;
//uniform float4 _WorldSpaceLightPos0;
uniform float4 _LightColor0;
uniform sampler2D _LightTexture0;
uniform float4x4 unity_WorldToLight;
uniform sampler2D _MainTex;
uniform float _Cutoff;
struct appdata_t
{
    float4 tangent :TANGENT;
    float4 vertex :POSITION;
    float4 color :COLOR;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float4 xlv_COLOR0 :COLOR0;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float4 xlv_COLOR0 :COLOR0;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    tmpvar_1 = in_v.color;
    float3 worldNormal_2;
    float3 tmpvar_3;
    float4 pos_4;
    pos_4 = in_v.vertex;
    float2 offset_5;
    offset_5 = in_v.tangent.xy;
    float3 tmpvar_6;
    tmpvar_6 = (in_v.vertex.xyz - _CameraPosition.xyz);
    float tmpvar_7;
    tmpvar_7 = dot(tmpvar_6, tmpvar_6);
    if((tmpvar_7>_WaveAndDistance.w))
    {
        offset_5 = float2(0, 0);
    }
    pos_4.xyz = (in_v.vertex.xyz + (offset_5.x * _CameraRight));
    pos_4.xyz = (pos_4.xyz + (offset_5.y * _CameraUp));
    float4 vertex_8;
    vertex_8.yw = pos_4.yw;
    float4 color_9;
    color_9.xyz = tmpvar_1.xyz;
    float3 waveColor_10;
    float3 waveMove_11;
    float4 s_12;
    float4 waves_13;
    waves_13 = (pos_4.x * (float4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
    waves_13 = (waves_13 + (pos_4.z * (float4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
    waves_13 = (waves_13 + (_WaveAndDistance.x * float4(1.2, 2, 1.6, 4.8)));
    float4 tmpvar_14;
    tmpvar_14 = frac(waves_13);
    waves_13 = tmpvar_14;
    float4 val_15;
    float4 s_16;
    val_15 = ((tmpvar_14 * 6.408849) - 3.141593);
    float4 tmpvar_17;
    tmpvar_17 = (val_15 * val_15);
    float4 tmpvar_18;
    tmpvar_18 = (tmpvar_17 * val_15);
    float4 tmpvar_19;
    tmpvar_19 = (tmpvar_18 * tmpvar_17);
    s_16 = (((val_15 + (tmpvar_18 * (-0.1616162))) + (tmpvar_19 * 0.0083333)) + ((tmpvar_19 * tmpvar_17) * (-0.00019841)));
    s_12 = (s_16 * s_16);
    s_12 = (s_12 * s_12);
    float tmpvar_20;
    tmpvar_20 = (dot(s_12, float4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
    s_12 = (s_12 * in_v.tangent.y);
    waveMove_11.y = 0;
    waveMove_11.x = dot(s_12, float4(0.024, 0.04, (-0.12), 0.096));
    waveMove_11.z = dot(s_12, float4(0.006, 0.02, (-0.02), 0.1));
    vertex_8.xz = (pos_4.xz - (waveMove_11.xz * _WaveAndDistance.z));
    float3 tmpvar_21;
    tmpvar_21 = lerp(float3(0.5, 0.5, 0.5), _WavingTint.xyz, float3(tmpvar_20, tmpvar_20, tmpvar_20));
    waveColor_10 = tmpvar_21;
    float3 tmpvar_22;
    tmpvar_22 = (vertex_8.xyz - _CameraPosition.xyz);
    float tmpvar_23;
    tmpvar_23 = clamp(((2 * (_WaveAndDistance.w - dot(tmpvar_22, tmpvar_22))) * _CameraPosition.w), 0, 1);
    color_9.w = tmpvar_23;
    float4 tmpvar_24;
    tmpvar_24.xyz = ((2 * waveColor_10) * in_v.color.xyz);
    tmpvar_24.w = color_9.w;
    float4 v_25;
    v_25.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_25.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_25.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_25.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_26;
    v_26.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_26.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_26.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_26.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_27;
    v_27.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_27.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_27.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_27.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_28;
    tmpvar_28 = normalize((((v_25.xyz * in_v.normal.x) + (v_26.xyz * in_v.normal.y)) + (v_27.xyz * in_v.normal.z)));
    worldNormal_2 = tmpvar_28;
    tmpvar_3 = worldNormal_2;
    out_v.vertex = UnityObjectToClipPos(vertex_8);
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = mul(unity_ObjectToWorld, vertex_8).xyz;
    out_v.xlv_COLOR0 = tmpvar_24;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float4 c_3;
    float3 tmpvar_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = normalize((_WorldSpaceLightPos0.xyz - in_f.xlv_TEXCOORD2));
    lightDir_5 = tmpvar_6;
    tmpvar_4 = in_f.xlv_TEXCOORD1;
    float4 tmpvar_7;
    tmpvar_7 = (tex2D(_MainTex, in_f.xlv_TEXCOORD0) * in_f.xlv_COLOR0);
    float x_8;
    x_8 = (tmpvar_7.w - _Cutoff);
    if((x_8<0))
    {
        discard;
    }
    float4 tmpvar_9;
    tmpvar_9.w = 1;
    tmpvar_9.xyz = in_f.xlv_TEXCOORD2;
    float3 tmpvar_10;
    tmpvar_10 = mul(unity_WorldToLight, tmpvar_9).xyz;
    float tmpvar_11;
    tmpvar_11 = dot(tmpvar_10, tmpvar_10);
    float tmpvar_12;
    tmpvar_12 = tex2D(_LightTexture0, float2(tmpvar_11, tmpvar_11)).w;
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    tmpvar_1 = (tmpvar_1 * tmpvar_12);
    float4 c_13;
    float4 c_14;
    float diff_15;
    float tmpvar_16;
    tmpvar_16 = max(0, dot(tmpvar_4, tmpvar_2));
    diff_15 = tmpvar_16;
    c_14.xyz = ((tmpvar_7.xyz * tmpvar_1) * diff_15);
    c_14.w = (tmpvar_7.w * in_f.xlv_COLOR0.w);
    c_13.w = c_14.w;
    c_13.xyz = c_14.xyz;
    c_3.xyz = c_13.xyz;
    c_3.w = 1;
    out_f.color = c_3;
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassBase" "QUEUE"="Geometry+200" "IGNOREPROJECTOR"="true" "DisableBatching"="true" "RenderType"="GrassBillboard" }
  Cull Off
  ColorMask RGB
  GpuProgramID 187541
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _WavingTint;
uniform float4 _WaveAndDistance;
uniform float4 _CameraPosition;
uniform float3 _CameraRight;
uniform float3 _CameraUp;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
uniform float _Cutoff;
struct appdata_t
{
    float4 tangent :TANGENT;
    float4 vertex :POSITION;
    float4 color :COLOR;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float4 xlv_COLOR0 :COLOR0;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float4 xlv_COLOR0 :COLOR0;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    tmpvar_1 = in_v.color;
    float3 worldNormal_2;
    float3 tmpvar_3;
    float4 pos_4;
    pos_4 = in_v.vertex;
    float2 offset_5;
    offset_5 = in_v.tangent.xy;
    float3 tmpvar_6;
    tmpvar_6 = (in_v.vertex.xyz - _CameraPosition.xyz);
    float tmpvar_7;
    tmpvar_7 = dot(tmpvar_6, tmpvar_6);
    if((tmpvar_7>_WaveAndDistance.w))
    {
        offset_5 = float2(0, 0);
    }
    pos_4.xyz = (in_v.vertex.xyz + (offset_5.x * _CameraRight));
    pos_4.xyz = (pos_4.xyz + (offset_5.y * _CameraUp));
    float4 vertex_8;
    vertex_8.yw = pos_4.yw;
    float4 color_9;
    color_9.xyz = tmpvar_1.xyz;
    float3 waveColor_10;
    float3 waveMove_11;
    float4 s_12;
    float4 waves_13;
    waves_13 = (pos_4.x * (float4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
    waves_13 = (waves_13 + (pos_4.z * (float4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
    waves_13 = (waves_13 + (_WaveAndDistance.x * float4(1.2, 2, 1.6, 4.8)));
    float4 tmpvar_14;
    tmpvar_14 = frac(waves_13);
    waves_13 = tmpvar_14;
    float4 val_15;
    float4 s_16;
    val_15 = ((tmpvar_14 * 6.408849) - 3.141593);
    float4 tmpvar_17;
    tmpvar_17 = (val_15 * val_15);
    float4 tmpvar_18;
    tmpvar_18 = (tmpvar_17 * val_15);
    float4 tmpvar_19;
    tmpvar_19 = (tmpvar_18 * tmpvar_17);
    s_16 = (((val_15 + (tmpvar_18 * (-0.1616162))) + (tmpvar_19 * 0.0083333)) + ((tmpvar_19 * tmpvar_17) * (-0.00019841)));
    s_12 = (s_16 * s_16);
    s_12 = (s_12 * s_12);
    float tmpvar_20;
    tmpvar_20 = (dot(s_12, float4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
    s_12 = (s_12 * in_v.tangent.y);
    waveMove_11.y = 0;
    waveMove_11.x = dot(s_12, float4(0.024, 0.04, (-0.12), 0.096));
    waveMove_11.z = dot(s_12, float4(0.006, 0.02, (-0.02), 0.1));
    vertex_8.xz = (pos_4.xz - (waveMove_11.xz * _WaveAndDistance.z));
    float3 tmpvar_21;
    tmpvar_21 = lerp(float3(0.5, 0.5, 0.5), _WavingTint.xyz, float3(tmpvar_20, tmpvar_20, tmpvar_20));
    waveColor_10 = tmpvar_21;
    float3 tmpvar_22;
    tmpvar_22 = (vertex_8.xyz - _CameraPosition.xyz);
    float tmpvar_23;
    tmpvar_23 = clamp(((2 * (_WaveAndDistance.w - dot(tmpvar_22, tmpvar_22))) * _CameraPosition.w), 0, 1);
    color_9.w = tmpvar_23;
    float4 tmpvar_24;
    tmpvar_24.xyz = ((2 * waveColor_10) * in_v.color.xyz);
    tmpvar_24.w = color_9.w;
    float4 v_25;
    v_25.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_25.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_25.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_25.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_26;
    v_26.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_26.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_26.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_26.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_27;
    v_27.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_27.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_27.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_27.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_28;
    tmpvar_28 = normalize((((v_25.xyz * in_v.normal.x) + (v_26.xyz * in_v.normal.y)) + (v_27.xyz * in_v.normal.z)));
    worldNormal_2 = tmpvar_28;
    tmpvar_3 = worldNormal_2;
    out_v.vertex = UnityObjectToClipPos(vertex_8);
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_TEXCOORD1 = tmpvar_3;
    out_v.xlv_TEXCOORD2 = mul(unity_ObjectToWorld, vertex_8).xyz;
    out_v.xlv_COLOR0 = tmpvar_24;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 res_1;
    float3 tmpvar_2;
    tmpvar_2 = in_f.xlv_TEXCOORD1;
    float x_3;
    x_3 = ((tex2D(_MainTex, in_f.xlv_TEXCOORD0) * in_f.xlv_COLOR0).w - _Cutoff);
    if((x_3<0))
    {
        discard;
    }
    res_1.xyz = float3(((tmpvar_2 * 0.5) + 0.5));
    res_1.w = 0;
    out_f.color = res_1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "PREPASS"
  Tags { "LIGHTMODE"="PrePassFinal" "QUEUE"="Geometry+200" "IGNOREPROJECTOR"="true" "DisableBatching"="true" "RenderType"="GrassBillboard" }
  ZWrite Off
  Cull Off
  ColorMask RGB
  GpuProgramID 228808
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _ProjectionParams;
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _WavingTint;
uniform float4 _WaveAndDistance;
uniform float4 _CameraPosition;
uniform float3 _CameraRight;
uniform float3 _CameraUp;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
uniform float _Cutoff;
uniform sampler2D _LightBuffer;
struct appdata_t
{
    float4 tangent :TANGENT;
    float4 vertex :POSITION;
    float4 color :COLOR;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float4 xlv_COLOR0 :COLOR0;
    float4 xlv_TEXCOORD2 :TEXCOORD2;
    float4 xlv_TEXCOORD3 :TEXCOORD3;
    float3 xlv_TEXCOORD4 :TEXCOORD4;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_COLOR0 :COLOR0;
    float4 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD4 :TEXCOORD4;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    tmpvar_1 = in_v.color;
    float4 tmpvar_2;
    float4 tmpvar_3;
    float3 tmpvar_4;
    float4 pos_5;
    pos_5 = in_v.vertex;
    float2 offset_6;
    offset_6 = in_v.tangent.xy;
    float3 tmpvar_7;
    tmpvar_7 = (in_v.vertex.xyz - _CameraPosition.xyz);
    float tmpvar_8;
    tmpvar_8 = dot(tmpvar_7, tmpvar_7);
    if((tmpvar_8>_WaveAndDistance.w))
    {
        offset_6 = float2(0, 0);
    }
    pos_5.xyz = (in_v.vertex.xyz + (offset_6.x * _CameraRight));
    pos_5.xyz = (pos_5.xyz + (offset_6.y * _CameraUp));
    float4 vertex_9;
    vertex_9.yw = pos_5.yw;
    float4 color_10;
    color_10.xyz = tmpvar_1.xyz;
    float3 waveColor_11;
    float3 waveMove_12;
    float4 s_13;
    float4 waves_14;
    waves_14 = (pos_5.x * (float4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
    waves_14 = (waves_14 + (pos_5.z * (float4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
    waves_14 = (waves_14 + (_WaveAndDistance.x * float4(1.2, 2, 1.6, 4.8)));
    float4 tmpvar_15;
    tmpvar_15 = frac(waves_14);
    waves_14 = tmpvar_15;
    float4 val_16;
    float4 s_17;
    val_16 = ((tmpvar_15 * 6.408849) - 3.141593);
    float4 tmpvar_18;
    tmpvar_18 = (val_16 * val_16);
    float4 tmpvar_19;
    tmpvar_19 = (tmpvar_18 * val_16);
    float4 tmpvar_20;
    tmpvar_20 = (tmpvar_19 * tmpvar_18);
    s_17 = (((val_16 + (tmpvar_19 * (-0.1616162))) + (tmpvar_20 * 0.0083333)) + ((tmpvar_20 * tmpvar_18) * (-0.00019841)));
    s_13 = (s_17 * s_17);
    s_13 = (s_13 * s_13);
    float tmpvar_21;
    tmpvar_21 = (dot(s_13, float4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
    s_13 = (s_13 * in_v.tangent.y);
    waveMove_12.y = 0;
    waveMove_12.x = dot(s_13, float4(0.024, 0.04, (-0.12), 0.096));
    waveMove_12.z = dot(s_13, float4(0.006, 0.02, (-0.02), 0.1));
    vertex_9.xz = (pos_5.xz - (waveMove_12.xz * _WaveAndDistance.z));
    float3 tmpvar_22;
    tmpvar_22 = lerp(float3(0.5, 0.5, 0.5), _WavingTint.xyz, float3(tmpvar_21, tmpvar_21, tmpvar_21));
    waveColor_11 = tmpvar_22;
    float3 tmpvar_23;
    tmpvar_23 = (vertex_9.xyz - _CameraPosition.xyz);
    float tmpvar_24;
    tmpvar_24 = clamp(((2 * (_WaveAndDistance.w - dot(tmpvar_23, tmpvar_23))) * _CameraPosition.w), 0, 1);
    color_10.w = tmpvar_24;
    float4 tmpvar_25;
    tmpvar_25.xyz = ((2 * waveColor_11) * in_v.color.xyz);
    tmpvar_25.w = color_10.w;
    tmpvar_2 = UnityObjectToClipPos(vertex_9);
    float4 o_26;
    float4 tmpvar_27;
    tmpvar_27 = (tmpvar_2 * 0.5);
    float2 tmpvar_28;
    tmpvar_28.x = tmpvar_27.x;
    tmpvar_28.y = (tmpvar_27.y * _ProjectionParams.x);
    o_26.xy = (tmpvar_28 + tmpvar_27.w);
    o_26.zw = tmpvar_2.zw;
    tmpvar_3.zw = float2(0, 0);
    tmpvar_3.xy = float2(0, 0);
    float4 v_29;
    v_29.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_29.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_29.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_29.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_30;
    v_30.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_30.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_30.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_30.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_31;
    v_31.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_31.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_31.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_31.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float4 tmpvar_32;
    tmpvar_32.w = 1;
    tmpvar_32.xyz = normalize((((v_29.xyz * in_v.normal.x) + (v_30.xyz * in_v.normal.y)) + (v_31.xyz * in_v.normal.z)));
    float4 normal_33;
    normal_33 = tmpvar_32;
    float3 res_34;
    float3 x_35;
    x_35.x = dot(unity_SHAr, normal_33);
    x_35.y = dot(unity_SHAg, normal_33);
    x_35.z = dot(unity_SHAb, normal_33);
    float3 x1_36;
    float4 tmpvar_37;
    tmpvar_37 = (normal_33.xyzz * normal_33.yzzx);
    x1_36.x = dot(unity_SHBr, tmpvar_37);
    x1_36.y = dot(unity_SHBg, tmpvar_37);
    x1_36.z = dot(unity_SHBb, tmpvar_37);
    res_34 = (x_35 + (x1_36 + (unity_SHC.xyz * ((normal_33.x * normal_33.x) - (normal_33.y * normal_33.y)))));
    float _tmp_dvx_209 = max(((1.055 * pow(max(res_34, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    res_34 = float3(_tmp_dvx_209, _tmp_dvx_209, _tmp_dvx_209);
    tmpvar_4 = res_34;
    out_v.vertex = tmpvar_2;
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_TEXCOORD1 = mul(unity_ObjectToWorld, vertex_9).xyz;
    out_v.xlv_COLOR0 = tmpvar_25;
    out_v.xlv_TEXCOORD2 = o_26;
    out_v.xlv_TEXCOORD3 = tmpvar_3;
    out_v.xlv_TEXCOORD4 = tmpvar_4;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 tmpvar_1;
    float4 c_2;
    float4 light_3;
    float4 tmpvar_4;
    tmpvar_4 = (tex2D(_MainTex, in_f.xlv_TEXCOORD0) * in_f.xlv_COLOR0);
    float x_5;
    x_5 = (tmpvar_4.w - _Cutoff);
    if((x_5<0))
    {
        discard;
    }
    float4 tmpvar_6;
    tmpvar_6 = tex2D(_LightBuffer, in_f.xlv_TEXCOORD2);
    light_3 = tmpvar_6;
    light_3 = (-log2(max(light_3, float4(0.001, 0.001, 0.001, 0.001))));
    light_3.xyz = (light_3.xyz + in_f.xlv_TEXCOORD4);
    float4 c_7;
    c_7.xyz = (tmpvar_4.xyz * light_3.xyz);
    c_7.w = (tmpvar_4.w * in_f.xlv_COLOR0.w);
    c_2.xyz = c_7.xyz;
    c_2.w = 1;
    tmpvar_1 = c_2;
    out_f.color = tmpvar_1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "SHADOWCASTER"
  Tags { "LIGHTMODE"="SHADOWCASTER" "QUEUE"="Geometry+200" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "DisableBatching"="true" "RenderType"="GrassBillboard" }
  Cull Off
  ColorMask RGB
  GpuProgramID 268685
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 unity_LightShadowBias;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
//uniform float4x4 unity_MatrixVP;
uniform float4 _WavingTint;
uniform float4 _WaveAndDistance;
uniform float4 _CameraPosition;
uniform float3 _CameraRight;
uniform float3 _CameraUp;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
uniform float _Cutoff;
struct appdata_t
{
    float4 tangent :TANGENT;
    float4 vertex :POSITION;
    float4 color :COLOR;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float4 xlv_COLOR0 :COLOR0;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float4 xlv_COLOR0 :COLOR0;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    tmpvar_1 = in_v.color;
    float2 tmpvar_2;
    float4 pos_3;
    pos_3 = in_v.vertex;
    float2 offset_4;
    offset_4 = in_v.tangent.xy;
    float3 tmpvar_5;
    tmpvar_5 = (in_v.vertex.xyz - _CameraPosition.xyz);
    float tmpvar_6;
    tmpvar_6 = dot(tmpvar_5, tmpvar_5);
    if((tmpvar_6>_WaveAndDistance.w))
    {
        offset_4 = float2(0, 0);
    }
    pos_3.xyz = (in_v.vertex.xyz + (offset_4.x * _CameraRight));
    pos_3.xyz = (pos_3.xyz + (offset_4.y * _CameraUp));
    float4 vertex_7;
    vertex_7.yw = pos_3.yw;
    float4 color_8;
    color_8.xyz = tmpvar_1.xyz;
    float3 waveColor_9;
    float3 waveMove_10;
    float4 s_11;
    float4 waves_12;
    waves_12 = (pos_3.x * (float4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
    waves_12 = (waves_12 + (pos_3.z * (float4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
    waves_12 = (waves_12 + (_WaveAndDistance.x * float4(1.2, 2, 1.6, 4.8)));
    float4 tmpvar_13;
    tmpvar_13 = frac(waves_12);
    waves_12 = tmpvar_13;
    float4 val_14;
    float4 s_15;
    val_14 = ((tmpvar_13 * 6.408849) - 3.141593);
    float4 tmpvar_16;
    tmpvar_16 = (val_14 * val_14);
    float4 tmpvar_17;
    tmpvar_17 = (tmpvar_16 * val_14);
    float4 tmpvar_18;
    tmpvar_18 = (tmpvar_17 * tmpvar_16);
    s_15 = (((val_14 + (tmpvar_17 * (-0.1616162))) + (tmpvar_18 * 0.0083333)) + ((tmpvar_18 * tmpvar_16) * (-0.00019841)));
    s_11 = (s_15 * s_15);
    s_11 = (s_11 * s_11);
    float tmpvar_19;
    tmpvar_19 = (dot(s_11, float4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
    s_11 = (s_11 * in_v.tangent.y);
    waveMove_10.y = 0;
    waveMove_10.x = dot(s_11, float4(0.024, 0.04, (-0.12), 0.096));
    waveMove_10.z = dot(s_11, float4(0.006, 0.02, (-0.02), 0.1));
    vertex_7.xz = (pos_3.xz - (waveMove_10.xz * _WaveAndDistance.z));
    float3 tmpvar_20;
    tmpvar_20 = lerp(float3(0.5, 0.5, 0.5), _WavingTint.xyz, float3(tmpvar_19, tmpvar_19, tmpvar_19));
    waveColor_9 = tmpvar_20;
    float3 tmpvar_21;
    tmpvar_21 = (vertex_7.xyz - _CameraPosition.xyz);
    float tmpvar_22;
    tmpvar_22 = clamp(((2 * (_WaveAndDistance.w - dot(tmpvar_21, tmpvar_21))) * _CameraPosition.w), 0, 1);
    color_8.w = tmpvar_22;
    float4 tmpvar_23;
    tmpvar_23.xyz = ((2 * waveColor_9) * in_v.color.xyz);
    tmpvar_23.w = color_8.w;
    tmpvar_2 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    float3 tmpvar_24;
    tmpvar_24 = mul(unity_ObjectToWorld, vertex_7).xyz;
    float3 vertex_25;
    vertex_25 = vertex_7.xyz;
    float4 clipPos_26;
    if((unity_LightShadowBias.z!=0))
    {
        float4 tmpvar_27;
        tmpvar_27.w = 1;
        tmpvar_27.xyz = float3(vertex_25);
        float3 tmpvar_28;
        tmpvar_28 = mul(unity_ObjectToWorld, tmpvar_27).xyz;
        float4 v_29;
        v_29.x = conv_mxt4x4_0(unity_WorldToObject).x;
        v_29.y = conv_mxt4x4_1(unity_WorldToObject).x;
        v_29.z = conv_mxt4x4_2(unity_WorldToObject).x;
        v_29.w = conv_mxt4x4_3(unity_WorldToObject).x;
        float4 v_30;
        v_30.x = conv_mxt4x4_0(unity_WorldToObject).y;
        v_30.y = conv_mxt4x4_1(unity_WorldToObject).y;
        v_30.z = conv_mxt4x4_2(unity_WorldToObject).y;
        v_30.w = conv_mxt4x4_3(unity_WorldToObject).y;
        float4 v_31;
        v_31.x = conv_mxt4x4_0(unity_WorldToObject).z;
        v_31.y = conv_mxt4x4_1(unity_WorldToObject).z;
        v_31.z = conv_mxt4x4_2(unity_WorldToObject).z;
        v_31.w = conv_mxt4x4_3(unity_WorldToObject).z;
        float3 tmpvar_32;
        tmpvar_32 = normalize((((v_29.xyz * in_v.normal.x) + (v_30.xyz * in_v.normal.y)) + (v_31.xyz * in_v.normal.z)));
        float tmpvar_33;
        tmpvar_33 = dot(tmpvar_32, normalize((_WorldSpaceLightPos0.xyz - (tmpvar_28 * _WorldSpaceLightPos0.w))));
        float4 tmpvar_34;
        tmpvar_34.w = 1;
        tmpvar_34.xyz = (tmpvar_28 - (tmpvar_32 * (unity_LightShadowBias.z * sqrt((1 - (tmpvar_33 * tmpvar_33))))));
        clipPos_26 = mul(unity_MatrixVP, tmpvar_34);
    }
    else
    {
        float4 tmpvar_35;
        tmpvar_35.w = 1;
        tmpvar_35.xyz = float3(vertex_25);
        clipPos_26 = UnityObjectToClipPos(tmpvar_35);
    }
    float4 clipPos_36;
    clipPos_36.xyw = clipPos_26.xyw;
    clipPos_36.z = (clipPos_26.z + clamp((unity_LightShadowBias.x / clipPos_26.w), 0, 1));
    clipPos_36.z = lerp(clipPos_36.z, max(clipPos_36.z, (-clipPos_26.w)), unity_LightShadowBias.y);
    out_v.vertex = clipPos_36;
    out_v.xlv_TEXCOORD1 = tmpvar_2;
    out_v.xlv_TEXCOORD2 = tmpvar_24;
    out_v.xlv_COLOR0 = tmpvar_23;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float x_1;
    x_1 = ((tex2D(_MainTex, in_f.xlv_TEXCOORD1) * in_f.xlv_COLOR0).w - _Cutoff);
    if((x_1<0))
    {
        discard;
    }
    out_f.color = float4(0, 0, 0, 0);
    return out_f;
}


ENDCG

}
}
Fallback Off
}